package com.vijay.exam;


import java.util.List;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

		QuesDAO quesDAO = (QuesDAO) ctx.getBean("QuesDAO");
		PaperDAO paperDAO=(PaperDAO) ctx.getBean("PaperDAO");
		
		// Main m=new Main();
		// m.getAllQues();
		Session session = quesDAO.getSessionFactory().openSession();
		Transaction txn = session.beginTransaction();
		txn.begin();
		List<String> paperLst = paperDAO.findDistinctPaper();
		for(String p: paperLst){
			System.out.println(p);
		}
//
//		List<Ques> lst = quesDAO.findAll();
//		for (Ques q : lst) {
//			System.out.println(q.getQno() + " : " + q.getQdesc());
//			
//		}

	}

	void getAllQues() {

	}
}
